package com.ruoyi.clap.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.clap.mapper.XlkjClapMapper;
import com.ruoyi.clap.domain.XlkjClap;
import com.ruoyi.clap.service.IXlkjClapService;

/**
 * 随手拍Service业务层处理
 *
 * @author wang
 * @date 2022-01-16
 */
@Service
public class XlkjClapServiceImpl implements IXlkjClapService
{
    @Autowired
    private XlkjClapMapper xlkjClapMapper;

    /**
     * 查询随手拍
     *
     * @param id 随手拍主键
     * @return 随手拍
     */
    @Override
    public XlkjClap selectXlkjClapById(Long id)
    {
        return xlkjClapMapper.selectXlkjClapById(id);
    }

    /**
     * 查询随手拍列表
     *
     * @param xlkjClap 随手拍
     * @return 随手拍
     */
    @Override
    public List<XlkjClap> selectXlkjClapList(XlkjClap xlkjClap)
    {
        return xlkjClapMapper.selectXlkjClapList(xlkjClap);
    }

    /**
     * 新增随手拍
     *
     * @param xlkjClap 随手拍
     * @return 结果
     */
    @Override
    public int insertXlkjClap(XlkjClap xlkjClap)
    {
        xlkjClap.setCreateTime(DateUtils.getNowDate());
        return xlkjClapMapper.insertXlkjClap(xlkjClap);
    }

    /**
     * 修改随手拍
     *
     * @param xlkjClap 随手拍
     * @return 结果
     */
    @Override
    public int updateXlkjClap(XlkjClap xlkjClap)
    {
        xlkjClap.setUpdateTime(DateUtils.getNowDate());
        xlkjClap.setUpdateBy(SecurityUtils.getUsername());
        return xlkjClapMapper.updateXlkjClap(xlkjClap);
    }

    /**
     * 批量删除随手拍
     *
     * @param ids 需要删除的随手拍主键
     * @return 结果
     */
    @Override
    public int deleteXlkjClapByIds(Long[] ids)
    {
        return xlkjClapMapper.deleteXlkjClapByIds(ids);
    }

    /**
     * 删除随手拍信息
     *
     * @param id 随手拍主键
     * @return 结果
     */
    @Override
    public int deleteXlkjClapById(Long id)
    {
        return xlkjClapMapper.deleteXlkjClapById(id);
    }
}
